import request from "@/utils/request.js";

export const pushBuyOrder=(pushData)=>{
    const params = new URLSearchParams()
    params.append('stockSymbol', pushData.value.stockSymbol)
    params.append('orderAmount',pushData.value.orderAmount)
    params.append('stockQuantity',pushData.value.stockQuantity)
    params.append('nowPrice',pushData.value.nowPrice)
    return request.post('order/sendBuyOrder', params);
}

export const pushSellOrder=(pushData)=>{
    const params = new URLSearchParams()
    params.append('stockSymbol', pushData.value.stockSymbol)
    params.append('orderAmount',pushData.value.orderAmount)
    params.append('stockQuantity',pushData.value.stockQuantity)
    params.append('nowPrice',pushData.value.nowPrice)
    return request.post('order/sendSellOrder', params);
}

export const cancelOrder=(orderId)=>{
    const params = new URLSearchParams()
    params.append('orderId', orderId.value.orderId)
    return request.post('order/cancelOrder', params);
}